﻿using PEMath;

/****************************************************
// 功能：血量回复Buff
// | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
// | Copyright (c) 2021-2025 聊来 All rights reserved.
// | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">聊来</a> )
// | @Author: 贯彻己道的云 <18970881148@qq.com>
// | DateTime: 2025/4/9 11:37:01
*****************************************************/
public class HPCureBuffCfg : BuffCfg {
    public int cureHPpct;
}

public class HPCureBuff_Single : Buff {
    public PEInt cureHPpct;

    public HPCureBuff_Single(MainLogicUnit source, MainLogicUnit owner, Skill skill, int buffID, object[] args = null)
        : base(source, owner, skill, buffID, args) {
    }

    public override void LogicInit() {
        base.LogicInit();

        HPCureBuffCfg hcbc = cfg as HPCureBuffCfg;
        cureHPpct = hcbc.cureHPpct;
    }

    protected override void Tick() {
        base.Tick();
        if(owner.unitState == UnitStateEnum.Alive) {
            owner.GetCureByBuff(owner.unitData.unitConfig.hp * cureHPpct / 100, this);
        }
    }
}
